﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GaiNo.Core.Services
{
    public interface ICrypto
    {
        /// <summary>
        /// DES加密字符串
        /// </summary>
        /// <param name="encryptString">待加密的字符串</param>
        /// <param name="encryptKey">加密密钥,要求为8位</param>
        /// <returns>加密成功返回加密后的字符串，失败返回源串</returns>
        string EncryptDES(string encryptString, string encryptKey);
        /// <summary>
        /// DES解密字符串
        /// </summary>
        /// <param name="decryptString">待解密的字符串</param>
        /// <param name="decryptKey">解密密钥,要求为8位,和加密密钥相同</param>
        /// <returns>解密成功返回解密后的字符串，失败返源串</returns>
        string DecryptDES(string decryptString, string decryptKey);
        /// <summary>
        /// MD5加密.
        /// </summary>
        /// <param name="source">待加密字串</param>
        /// <returns>加密后的字串,16位</returns>
        string MD5Encrypt(string source);
        /// <summary>
        /// MD5加密.
        /// </summary>
        /// <param name="source">待加密字串</param>
        /// <param name="length">6,32,64或128值之一,其它则采用.net默认MD5加密算法</param>
        /// <returns>加密后的字串</returns>
        string MD5Encrypt(string source, int length);

        /// <summary>
        /// SHA1加密
        /// </summary>
        /// <param name="source">待加密字串</param>
        /// <returns>加密后的字串</returns>
        string SHA1Encrypt(string source);
    }
}
